import lejos.nxt.*;

public class BlackWhiteTest {

	private static String black = "Is Black";
	private static String white = "IS White";
	
	public static void main(String[] args) {
		BlackWhiteSensor sensor = new BlackWhiteSensor(SensorPort.S3);
		
		sensor.calibrate();
		
		while(!Button.ESCAPE.isPressed()) {
			
			LCD.drawInt(sensor.light(), 0, 1);
			
			if(sensor.black()) {
				LCD.drawString(black, 0, 2);
			} else if(sensor.white()) {
				LCD.drawString(white, 0, 2);
			}
		}
	}
}
